MODULE	= toshiba-pmfix
VERSION	= 1.0
SRCDIR	= $(MODULE)-$(VERSION)
SRCPATH	= /usr/src/$(SRCDIR)

CP	= cp
RM	= rm
MKDIR	= mkdir
DKMS	= dkms

obj-m	+= $(MODULE).o

all:
	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

dkms:
	$(MAKE) clean
	$(RM) -rf $(SRCPATH)
	$(MKDIR) -p $(SRCPATH)
	$(CP) -a ./* $(SRCPATH)
	-$(DKMS) remove -m $(MODULE) -v $(VERSION) --all
	$(DKMS) add -m $(MODULE) -v $(VERSION)
	$(DKMS) build -m $(MODULE) -v $(VERSION)
	$(DKMS) install -m $(MODULE) -v $(VERSION)


